﻿#if USE_UNI_LUA
using LuaAPI = UniLua.Lua;
using RealStatePtr = UniLua.ILuaState;
using LuaCSFunction = UniLua.CSharpFunctionDelegate;
#else
using LuaAPI = XLua.LuaDLL.Lua;
using RealStatePtr = System.IntPtr;
using LuaCSFunction = XLua.LuaDLL.lua_CSFunction;
#endif

using XLua;
using System.Collections.Generic;


namespace XLua.CSObjectWrap
{
    using Utils = XLua.Utils;
    public class UnityEngineNetworkingDownloadHandlerAudioClipWrap 
    {
        public static void __Register(RealStatePtr L)
        {
			ObjectTranslator translator = ObjectTranslatorPool.Instance.Find(L);
			System.Type type = typeof(UnityEngine.Networking.DownloadHandlerAudioClip);
			Utils.BeginObjectRegister(type, L, translator, 0, 0, 3, 2);
			
			
			
			Utils.RegisterFunc(L, Utils.GETTER_IDX, "audioClip", _g_get_audioClip);
            Utils.RegisterFunc(L, Utils.GETTER_IDX, "streamAudio", _g_get_streamAudio);
            Utils.RegisterFunc(L, Utils.GETTER_IDX, "compressed", _g_get_compressed);
            
			Utils.RegisterFunc(L, Utils.SETTER_IDX, "streamAudio", _s_set_streamAudio);
            Utils.RegisterFunc(L, Utils.SETTER_IDX, "compressed", _s_set_compressed);
            
			
			Utils.EndObjectRegister(type, L, translator, null, null,
			    null, null, null);

		    Utils.BeginClassRegister(type, L, __CreateInstance, 2, 0, 0);
			Utils.RegisterFunc(L, Utils.CLS_IDX, "GetContent", _m_GetContent_xlua_st_);
            
			
            
			
			
			
			Utils.EndClassRegister(type, L, translator);
        }
        
        [MonoPInvokeCallbackAttribute(typeof(LuaCSFunction))]
        static int __CreateInstance(RealStatePtr L)
        {
            
			try {
                ObjectTranslator translator = ObjectTranslatorPool.Instance.Find(L);
				if(LuaAPI.lua_gettop(L) == 3 && (LuaAPI.lua_isnil(L, 2) || LuaAPI.lua_type(L, 2) == LuaTypes.LUA_TSTRING) && translator.Assignable<UnityEngine.AudioType>(L, 3))
				{
					string _url = LuaAPI.lua_tostring(L, 2);
					UnityEngine.AudioType _audioType;translator.Get(L, 3, out _audioType);
					
					var gen_ret = new UnityEngine.Networking.DownloadHandlerAudioClip(_url, _audioType);
					translator.Push(L, gen_ret);
                    
					return 1;
				}
				if(LuaAPI.lua_gettop(L) == 3 && translator.Assignable<System.Uri>(L, 2) && translator.Assignable<UnityEngine.AudioType>(L, 3))
				{
					System.Uri _uri = (System.Uri)translator.GetObject(L, 2, typeof(System.Uri));
					UnityEngine.AudioType _audioType;translator.Get(L, 3, out _audioType);
					
					var gen_ret = new UnityEngine.Networking.DownloadHandlerAudioClip(_uri, _audioType);
					translator.Push(L, gen_ret);
                    
					return 1;
				}
				
			}
			catch(System.Exception gen_e) {
				return LuaAPI.luaL_error(L, "c# exception:" + gen_e);
			}
            return LuaAPI.luaL_error(L, "invalid arguments to UnityEngine.Networking.DownloadHandlerAudioClip constructor!");
            
        }
        
		
        
		
        
        
        
        
        [MonoPInvokeCallbackAttribute(typeof(LuaCSFunction))]
        static int _m_GetContent_xlua_st_(RealStatePtr L)
        {
		    try {
            
                ObjectTranslator translator = ObjectTranslatorPool.Instance.Find(L);
            
            
            
                
                {
                    UnityEngine.Networking.UnityWebRequest _www = (UnityEngine.Networking.UnityWebRequest)translator.GetObject(L, 1, typeof(UnityEngine.Networking.UnityWebRequest));
                    
                        var gen_ret = UnityEngine.Networking.DownloadHandlerAudioClip.GetContent( _www );
                        translator.Push(L, gen_ret);
                    
                    
                    
                    return 1;
                }
                
            } catch(System.Exception gen_e) {
                return LuaAPI.luaL_error(L, "c# exception:" + gen_e);
            }
            
        }
        
        
        
        
        [MonoPInvokeCallbackAttribute(typeof(LuaCSFunction))]
        static int _g_get_audioClip(RealStatePtr L)
        {
		    try {
                ObjectTranslator translator = ObjectTranslatorPool.Instance.Find(L);
			
                UnityEngine.Networking.DownloadHandlerAudioClip gen_to_be_invoked = (UnityEngine.Networking.DownloadHandlerAudioClip)translator.FastGetCSObj(L, 1);
                translator.Push(L, gen_to_be_invoked.audioClip);
            } catch(System.Exception gen_e) {
                return LuaAPI.luaL_error(L, "c# exception:" + gen_e);
            }
            return 1;
        }
        
        [MonoPInvokeCallbackAttribute(typeof(LuaCSFunction))]
        static int _g_get_streamAudio(RealStatePtr L)
        {
		    try {
                ObjectTranslator translator = ObjectTranslatorPool.Instance.Find(L);
			
                UnityEngine.Networking.DownloadHandlerAudioClip gen_to_be_invoked = (UnityEngine.Networking.DownloadHandlerAudioClip)translator.FastGetCSObj(L, 1);
                LuaAPI.lua_pushboolean(L, gen_to_be_invoked.streamAudio);
            } catch(System.Exception gen_e) {
                return LuaAPI.luaL_error(L, "c# exception:" + gen_e);
            }
            return 1;
        }
        
        [MonoPInvokeCallbackAttribute(typeof(LuaCSFunction))]
        static int _g_get_compressed(RealStatePtr L)
        {
		    try {
                ObjectTranslator translator = ObjectTranslatorPool.Instance.Find(L);
			
                UnityEngine.Networking.DownloadHandlerAudioClip gen_to_be_invoked = (UnityEngine.Networking.DownloadHandlerAudioClip)translator.FastGetCSObj(L, 1);
                LuaAPI.lua_pushboolean(L, gen_to_be_invoked.compressed);
            } catch(System.Exception gen_e) {
                return LuaAPI.luaL_error(L, "c# exception:" + gen_e);
            }
            return 1;
        }
        
        
        
        [MonoPInvokeCallbackAttribute(typeof(LuaCSFunction))]
        static int _s_set_streamAudio(RealStatePtr L)
        {
		    try {
                ObjectTranslator translator = ObjectTranslatorPool.Instance.Find(L);
			
                UnityEngine.Networking.DownloadHandlerAudioClip gen_to_be_invoked = (UnityEngine.Networking.DownloadHandlerAudioClip)translator.FastGetCSObj(L, 1);
                gen_to_be_invoked.streamAudio = LuaAPI.lua_toboolean(L, 2);
            
            } catch(System.Exception gen_e) {
                return LuaAPI.luaL_error(L, "c# exception:" + gen_e);
            }
            return 0;
        }
        
        [MonoPInvokeCallbackAttribute(typeof(LuaCSFunction))]
        static int _s_set_compressed(RealStatePtr L)
        {
		    try {
                ObjectTranslator translator = ObjectTranslatorPool.Instance.Find(L);
			
                UnityEngine.Networking.DownloadHandlerAudioClip gen_to_be_invoked = (UnityEngine.Networking.DownloadHandlerAudioClip)translator.FastGetCSObj(L, 1);
                gen_to_be_invoked.compressed = LuaAPI.lua_toboolean(L, 2);
            
            } catch(System.Exception gen_e) {
                return LuaAPI.luaL_error(L, "c# exception:" + gen_e);
            }
            return 0;
        }
        
		
		
		
		
    }
}
